package cn.pupil.springframework.core.convert.converter;

/**
 * @Description: 类型转换注册接口
 * @Author: pupil
 * @Date: 2024/12/16 下午 4:35
 */
public interface ConverterRegistry {

    /**
     * Add a plain converter to this registry.
     * The convertible source/target type pair is derived from the Converter's parameterized types.
     * <p>
     * 向此注册表添加一个普通转换器。
     * 可转换的源/目标类型对是从Converter的参数化类型派生出来的。
     *
     * @throws IllegalArgumentException if the parameterized types could not be resolved 如果无法解析参数化类型
     */
    void addConverter(Converter<?, ?> converter);

    /**
     * Add a generic converter to this registry.
     * 将通用转换器添加到此注册表
     */
    void addConverter(GenericConverter converter);


    /**
     * Add a ranged converter factory to this registry.
     * The convertible source/target type pair is derived from the ConverterFactory's parameterized types.
     * 将范围转换器工厂添加到此注册表中。
     * 可转换的源/目标类型对是从ConverterFactory的参数化类型获取出来的。
     *
     * @throws IllegalArgumentException if the parameterized types could not be resolved 如果无法解析参数化类型
     */
    void addConverterFactory(ConverterFactory<?, ?> converterFactory);

}
